﻿using System.Linq.Expressions;
using Admin.ApplicationLib.Entities;
using Ardalis.Specification;
using Swimj.Core.DependencyInjection;

namespace Admin.ApplicationLib.Repositories
{
    public interface IRoleRepository : IRepositoryBase<RoleEntity>, IScopedDependency
    {
        Task EnsureCollectionLoadedAsync<TProperty>(RoleEntity entity,
            Expression<Func<RoleEntity, IEnumerable<TProperty>>> propertyExpression)
            where TProperty : class;

        Task<IList<RoleClaimEntity>> QueryClaimsByRoleAsync(Guid id);

        Task AddRoleClaimAsync(RoleClaimEntity roleClaimEntity);

        Task RemoveRoleClaimAsync(RoleClaimEntity item);
    
        Task<IList<UserRoleEntity>> QueryUserRolesByRoleAsync(Guid id);
        
        Task AddUserRoleAsync(UserRoleEntity userRoleEntity);
        
        Task RemoveUserRoleAsync(UserRoleEntity item);
    }
}